import java.nio.ByteBuffer;
import java.nio.ByteOrder;

public class SimpleMessageTest {
    public static void main(String[] args) {
        // Test message ID encoding
        int messageId = 8193; // Login message ID
        
        // Test little-endian encoding
        ByteBuffer leBuffer = ByteBuffer.allocate(4);
        leBuffer.order(ByteOrder.LITTLE_ENDIAN);
        leBuffer.putInt(messageId);
        
        System.out.println("Little-endian bytes:");
        for (byte b : leBuffer.array()) {
            System.out.print((b & 0xFF) + " ");
        }
        System.out.println();
        
        // Test big-endian encoding
        ByteBuffer beBuffer = ByteBuffer.allocate(4);
        beBuffer.order(ByteOrder.BIG_ENDIAN);
        beBuffer.putInt(messageId);
        
        System.out.println("Big-endian bytes:");
        for (byte b : beBuffer.array()) {
            System.out.print((b & 0xFF) + " ");
        }
        System.out.println();
        
        // Verify decoding
        leBuffer.rewind();
        int leDecoded = leBuffer.getInt();
        System.out.println("Little-endian decoded: " + leDecoded);
        
        beBuffer.rewind();
        int beDecoded = beBuffer.getInt();
        System.out.println("Big-endian decoded: " + beDecoded);
    }
}